/* =========================================
   Reset & Global Styles
   ========================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --link-color: #6cf;          
  --primary-btn: #2563eb;      
  --primary-btn-hover: #1d4ed8;
  --border-color: #2a2a2a;
  --card-hover-border: #444;   
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f0f0f;
  color: #e8e8e8;
  line-height: 1.5;
  max-width: 1400px; 
  margin: 0 auto;
  padding: 2rem 1.5rem; 
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0f0f0f; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }

/* =========================================
   Header & Links
   ========================================= */
.page-header { margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-color); }
.page-header h1 { font-size: 1.8rem; color: #fff; margin-bottom: 0.5rem; }
.header-meta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: 0.9rem; }
.repo-link { color: #888; margin: 0; display: flex; align-items: center; gap: 0.3rem; }
.repo-link a { color: var(--link-color); text-decoration: none; transition: opacity 0.2s; }
.repo-link a:hover { text-decoration: underline; opacity: 0.8; }
.divider { color: #333; font-size: 1.1rem; }
.downloads-badge { font-size: 0.85rem; color: #999; padding: 0.2rem 0.6rem; background: #1a1a1a; border-radius: 6px; display: none; }

.layout { display: flex; flex-direction: column; width: 100%; }
.main-content { display: flex; flex-direction: column; width: 100%; min-width: 0; }

/* =========================================
   Disclaimer Banner
   ========================================= */
.disclaimer-banner {
  background: #1a1a1a; border: 1px solid var(--border-color); border-left: 4px solid #b4a57a; 
  border-radius: 8px; padding: 1.2rem 1.5rem; margin-bottom: 2rem; width: 100%;
}
.disclaimer-header h2 { font-size: 1.1rem; color: #d4c59a; margin-bottom: 0.5rem; font-weight: 600; }
.disclaimer-content { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
@media (max-width: 900px) { .disclaimer-content { grid-template-columns: 1fr; } }
.disclaimer-item { font-size: 0.8rem; color: #999; line-height: 1.6; }
.disclaimer-item strong { color: #e0e0e0; display: block; margin-bottom: 0.3rem; }

/* =========================================
   导航区 (普通流式布局，两排展示)
   ========================================= */
#nav-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.nav-section { margin-bottom: 0; }
.nav-label { font-size: 0.85rem; color: #888; margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.nav-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.nav-btn { background: #252525; border: 1px solid #333; color: #aaa; padding: 0.4rem 0.8rem; border-radius: 6px; cursor: pointer; font-size: 0.85rem; transition: all 0.15s ease; font-family: inherit; font-weight: 600; }
.nav-btn:hover { background: #333; color: #fff; }
.nav-btn.active { background: var(--primary-btn); border-color: var(--primary-btn); color: #fff; }

/* =========================================
   Card Grid
   ========================================= */
.grid {
  display: grid !important; 
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)) !important;
  gap: 1rem; width: 100%; align-items: start;
}

.card {
  background: #181818; border: 1px solid #2a2a2a; border-radius: 10px; padding: 0.6rem;
  transition: border-color 0.3s ease, box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease;
  display: flex; flex-direction: column; position: relative; min-width: 0; width: 100%; height: fit-content;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.card:hover { 
  border-color: #666; background: #1e1e1e;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 20px rgba(37, 99, 235, 0.1);
  z-index: 10;
}

.card.hide { display: none !important; }

.card-badge {
  position: absolute; z-index: 20; pointer-events: none; text-transform: uppercase;
  top: 0.6rem; left: 0.6rem;
  background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(4px); 
  color: #e0e0e0; font-size: 0.7rem; padding: 0.25rem 0.6rem; border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.15); font-weight: 600; letter-spacing: 0.5px;
}

/* =========================================
   图片区与 Mask 遮罩动画
   ========================================= */
.card-image-wrap {
  width: 100%; aspect-ratio: 3 / 4; position: relative;
  border-radius: 6px; overflow: hidden; margin-bottom: 0.6rem; background: #151515; 
}

.preview { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.preview-missing { background: #151515; display: block; width: 100%; height: 100%; mask-image: none !important; }
.preview-missing::after {
  content: "No Image"; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%); color: #444; font-size: 0.8rem; font-weight: 600;
}

.img-skeleton { background: #1a1a1a; }
.img-skeleton::before {
  content: ""; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: linear-gradient(135deg, transparent 30%, rgba(255, 255, 255, 0.08) 50%, transparent 70%);
  animation: skeleton-sweep-diagonal 1.5s infinite linear; z-index: 5; pointer-events: none;
}
@keyframes skeleton-sweep-diagonal {
  0% { transform: translate(-40%, -40%); }
  100% { transform: translate(40%, 40%); }
}
.is-loaded::before { animation: none; opacity: 0; transition: opacity 0.2s; }

.reveal-img { opacity: 0; transition: opacity 0.5s ease-in-out; will-change: opacity; }
.reveal-img.loaded { opacity: 1; }

.title-overlay {
  position: absolute; bottom: 0; left: 0; right: 0; height: 45%;
  background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0) 100%);
  pointer-events: none; z-index: 5;
}

.image-bottom-info {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 0.8rem; z-index: 10;
  display: flex; flex-direction: column;
}
.image-bottom-info .card-title {
  font-size: 0.95rem; font-weight: 700; color: #fff; line-height: 1.3;
  word-break: break-word; text-shadow: 0 1px 3px rgba(0,0,0,0.8); margin-bottom: 0.2rem;
}
.image-bottom-info .card-category {
  font-size: 0.7rem; color: #aaa; font-weight: 600; letter-spacing: 0.5px;
  text-transform: uppercase; text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* =========================================
   Card Info
   ========================================= */
.card-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.card-details { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.6rem; }
.detail-block { display: flex; flex-direction: column; gap: 0.2rem; }
.detail-label { color: #666; font-size: 0.65rem; text-transform: uppercase; font-weight: 600; }

.path-box, .trigger-box {
  display: block; padding: 0.4rem 0.6rem; border-radius: 6px; cursor: pointer;
  transition: background 0.15s ease; width: 100%; background: #252525; border: none;
}
.path-box:hover, .trigger-box:hover { background: #333; }
.path-text, .trigger-text {
  font-family: ui-monospace, monospace; line-height: 1.5; word-break: break-word;
  display: block; color: #e8e8e8; font-size: 0.7rem; 
}
.path-box.copied, .trigger-box.copied { background: var(--primary-btn) !important; }
.path-box.copied .path-text, .trigger-box.copied .trigger-text { color: #fff !important; }
.trigger-list { display: flex; flex-direction: column; gap: 0.4rem; width: 100%; }
.trigger-empty { color: #555; font-size: 0.75rem; padding-left: 0.2rem; }

.card-actions {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.5rem; margin-top: auto; padding-top: 0.8rem; border-top: 1px solid #2a2a2a;
}
.action-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem;
  background: #252525; color: #e8e8e8 !important; padding: 0.4rem 0.6rem;
  border-radius: 6px; border: 1px solid #333; transition: all 0.15s ease;
  text-decoration: none !important; font-size: 0.75rem; font-weight: 600;
  white-space: nowrap; line-height: 1.2; flex: 1; text-align: center;
}
.action-btn:hover { background: #333; border-color: #555; color: #fff !important; }
.action-btn.primary { background: var(--primary-btn); border-color: var(--primary-btn); color: #fff !important; }
.action-btn.primary:hover { background: var(--primary-btn-hover); border-color: var(--primary-btn-hover); }

/* =========================================
   Animations
   ========================================= */
@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}