/* host-photos.css — 「主机照片」（共享盘老照片）浏览弹窗 + 灯箱 + 导航页卡片配色 */

/* 导航页「主机照片」卡片图标 */
.nav-card-icon.host-photos {
  background: linear-gradient(135deg, #e0e7ff, #a5b4fc);
  color: #4338ca;
}

/* ── 工具栏（搜索 + 刷新索引） ── */
.hp-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px 0;
}
.hp-search { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.hp-search-icon { position: absolute; left: 10px; color: #94a3b8; pointer-events: none; }
.hp-search-input {
  width: 100%;
  padding: 8px 30px 8px 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  background: #fff;
  color: var(--text-primary);
}
.hp-search-input:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.hp-search-clear {
  position: absolute; right: 6px;
  width: 22px; height: 22px;
  border: none; border-radius: 6px;
  background: none; color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.hp-search-clear:hover { background: #f1f5f9; color: var(--text-primary); }
.hp-search-clear.hidden { display: none; }

/* ── 搜索结果列表 ── */
.hp-results { display: flex; flex-direction: column; gap: 6px; }
.hp-result {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.hp-result:hover { border-color: #93c5fd; background: #f8fbff; }
.hp-result-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.hp-result-name {
  font-size: 13.5px; font-weight: 600; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hp-result-count { font-weight: 500; font-size: 11.5px; color: #64748b; margin-left: 8px; }
.hp-result-path {
  font-size: 11.5px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
mark.hp-hit { background: #fef08a; padding: 0 1px; border-radius: 2px; color: inherit; }

/* ── 扫描实时状态条（扫描中/上次扫描/失败） ── */
.hp-scan-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 20px 0;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  border: 1px solid transparent;
}
.hp-scan-status.hidden { display: none; }
.hp-scan-status.scanning { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.hp-scan-status.done { background: #f8fafc; border-color: var(--border); color: var(--text-secondary); }
.hp-scan-status.error { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.hp-scan-status .hp-spinner { width: 13px; height: 13px; border-width: 2px; flex: none; }

/* ── 弹窗骨架 ── */
.hp-modal-box {
  max-width: 1120px;
  width: 96vw;
  height: 86vh;
  display: flex;
  flex-direction: column;
}
.hp-head-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.hp-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px 20px;
  -webkit-overflow-scrolling: touch;
}
.hp-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.hp-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; font-size: 13px; }
.hp-crumb {
  color: #2563eb;
  cursor: pointer;
  padding: 3px 7px;
  border-radius: 6px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hp-crumb:hover { background: #eff6ff; }
.hp-crumb.current { color: var(--text-primary); font-weight: 600; cursor: default; }
.hp-crumb.current:hover { background: none; }
.hp-crumb-sep { color: #cbd5e1; font-size: 11px; }
.hp-actions { display: flex; gap: 8px; }
.hp-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.hp-btn:hover { background: #f8fafc; color: var(--text-primary); }
.hp-btn.primary { background: #4f46e5; border-color: #4f46e5; color: #fff; }
.hp-btn.primary:hover { background: #4338ca; }
.hp-btn:disabled { opacity: .55; cursor: not-allowed; }

.hp-section-label {
  font-size: 12px;
  color: var(--text-muted);
  margin: 6px 0 8px;
}
.hp-note {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  margin-bottom: 12px;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── 文件夹卡片 ── */
.hp-folders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.hp-folder {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: var(--transition, all .15s);
}
.hp-folder:hover { border-color: #93c5fd; background: #f8fbff; }
.hp-folder-icon { color: #f59e0b; flex: none; display: flex; }
.hp-folder-main { min-width: 0; flex: 1; }
.hp-folder-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hp-folder-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* ── 照片网格 ── */
.hp-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
  gap: 10px;
}
.hp-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #f1f5f9;
  border: 1px solid var(--border);
  cursor: pointer;
}
.hp-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hp-tile .hp-tile-name {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
  color: #fff; font-size: 11px; padding: 12px 6px 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hp-tile-state {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: #64748b; font-size: 11.5px; text-align: center; padding: 6px;
}
.hp-tile-state.error { color: #b91c1c; cursor: pointer; }
.hp-spinner {
  width: 18px; height: 18px;
  border: 2px solid #cbd5e1; border-top-color: #4f46e5;
  border-radius: 50%;
  animation: hpSpin .8s linear infinite;
}
@keyframes hpSpin { to { transform: rotate(360deg); } }

.hp-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 40px 16px;
  line-height: 1.9;
}
.hp-foot {
  border-top: 1px solid var(--border);
  padding: 9px 20px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .hp-modal-box { width: 100vw; height: 100vh; max-width: none; border-radius: 0; }
  .hp-folders { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .hp-photos { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
}
