/* quartz/static/movie-styles.css */

.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.1rem;
    margin: 2rem 0;
  }
  
  .movie-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.6rem 0.8rem; 
    margin: 0.5rem; /* ↓ 原来 gap 已经够了，这里缩小 */
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: auto; /* 自动适应内容 */
    min-height: 280px; /* 防止太扁 */
  }
  
  .movie-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  }
  
  .movie-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 0.1rem;
  }
  
  .movie-cover-wrapper {
    margin-bottom: 0.3rem;
    width: 100%;
    display: flex;
    justify-content: center;
  }
  
  .movie-cover {
    width: 100px;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  }
  
  .movie-cover-placeholder {
    width: 120px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    font-size: 3rem;
  }
  
  .movie-title-section {
    width: 100%;
  }
  
  .movie-title {
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0.2rem 0;
    color: #1f2937;
    line-height: 1.3;
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    line-clamp: 2;          /* 标准属性 */
    -webkit-line-clamp: 2;  /* WebKit 前缀 */
    -webkit-box-orient: vertical;
  }
  
  .movie-title a {
    text-decoration: none;
    color: inherit;
  }
  
  .movie-title a:hover {
    color: #2563eb;
  }
  
  .movie-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    margin-bottom: 0.1rem;
  }
  
  .stars {
    color: #f59e0b;
    font-size: 0.85rem;
  }
  
  .score {
    font-weight: 600;
    color: #f59e0b;
    font-size: 0.9rem;
  }
  
  .my-rating {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
  }
  
  .movie-info {
    margin-top: 0.3rem;
    font-size: 0.8rem;
    color: #6b7280;
    width: 100%;
    text-align: left;
    flex: 1; /* 占据剩余空间，把底部元素推下去 */
  }
  
  .info-row {
    display: flex;
    margin: 0.25rem 0;
    line-height: 1.5;
    flex-wrap: wrap;
  }
  
  .info-row .label {
    font-weight: 500;
    min-width: 50px;
    color: #4b5563;
    flex-shrink: 0;
  }
  
  .info-row span:last-child {
    flex: 1;
    word-break: break-word;
  }
  
  .movie-progress {
    margin-top: 0.8rem;
    width: 100%;
    height: 5px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
  
    margin-top: auto; /* 自动推到底部 */
  }
  
  .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    transition: width 0.3s ease;
  }
  
  .progress-text {
    text-align: center;
    font-size: 0.7rem;
    color: #6b7280;
    margin-top: 0.3rem;
    font-weight: 500;
  }
  
  .movie-status {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 0.8rem;
    letter-spacing: 0.3px;
  
    align-self: flex-start;
    /* 不需要 margin-top: auto，因为进度条已经推到底部了 */
  }
  
  .status-正在观看 {
    background: #dbeafe;
    color: #1e40af;
  }
  
  .status-已看 {
    background: #d1fae5;
    color: #065f46;
  }
  
  .status-待看 {
    background: #fef3c7;
    color: #92400e;
  }
  
  .status-未开始 {
    background: #f3f4f6;
    color: #4b5563;
  }
  
  .status-概览 {
    background: #e0e7ff;
    color: #4338ca;
  }
  
  .status-Unknown {
    background: #f3f4f6;
    color: #6b7280;
  }
  
  .movie-query-loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
    font-size: 1.2rem;
  }
  
  .movie-query-error {
    text-align: center;
    padding: 2rem;
    color: #dc2626;
    background: #fee2e2;
    border-radius: 8px;
    margin: 1rem 0;
  }
  
  /* 响应式设计 */
  @media (min-width: 1600px) {
    .movie-grid {
      grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
  }
  
  @media (min-width: 1200px) and (max-width: 1599px) {
    .movie-grid {
      grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
  }
  
  @media (min-width: 768px) and (max-width: 1199px) {
    .movie-grid {
      grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    
    .movie-cover,
    .movie-cover-placeholder {
      width: 100px;
      height: 140px;
    }
  }
  
  @media (max-width: 767px) {
    .movie-grid {
      grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
      gap: 1rem;
    }
    
    .movie-card {
      padding: 1rem;
    }
    
    .movie-cover,
    .movie-cover-placeholder {
      width: 90px;
      height: 130px;
    }
    
    .movie-title {
      font-size: 0.9rem;
    }
  }
  
  /* Dark mode support */
  @media (prefers-color-scheme: dark) {
    .movie-card {
      background: #1f2937;
      border-color: #374151;
    }
    
    .movie-title {
      color: #f9fafb;
    }
    
    .movie-info {
      color: #d1d5db;
    }
    
    .info-row .label {
      color: #9ca3af;
    }
    
    .movie-query-loading {
      color: #d1d5db;
    }
  }