/* Publications Page - Optimized Layout */

/* Publication List Container */
#pub-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Year Headers */
.pub-year {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
  margin: 30px 0 20px 0;
  padding: 0;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 8px;
}

.pub-year:hover {
  color: #E87E04;
}

.pub-year .toggle-indicator {
  font-size: 20px;
  margin-left: 8px;
  color: #64748b;
  transition: color 0.2s ease;
}

.pub-year.collapsed .toggle-indicator {
  color: #E87E04;
}

/* Year Collapse Functionality */
/* Note: Collapse functionality is handled by JavaScript for precise control */

/* Content Cards - Individual Publication Boxes */
.content-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.content-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  transform: translateY(-2px);
  border-color: #E87E04;
}

.content-card li {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Publication Content Layout */
.publication-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Line 1: Number + Title Container */
.pub-title-container {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 0;
}

.pub-number-circle {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #E87E04 0%, #CC6600 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  box-shadow: 0 3px 8px rgba(232, 126, 4, 0.3);
}

.pub-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: #1e293b;
  margin: 0;
  flex: 1;
  padding-top: 2px;
}

/* Line 2: Authors */
.pub-authors {
  font-size: 15px;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
  padding-left: 56px; /* Align with title */
}

.first-author {
  font-weight: 600;
  color: #374151;
}

/* Line 3: Venue + Tier Button - 改为inline布局确保紧密跟随 */
.pub-venue-container {
  display: block; /* 改为block布局，让内容可以自然换行 */
  margin: 0;
  padding-left: 56px; /* Align with title */
  line-height: 1.6; /* 增加行高便于阅读 */
}

.pub-venue {
  font-size: 15px;
  color: #64748b;
  font-style: italic;
  margin: 0;
  display: inline; /* 确保期刊名称为inline */
}

/* Tier Buttons - 期刊会议等级标签 - 与资源按钮统一尺寸，通过字体加粗区分 */
.pub-tier-btn {
  display: inline !important; /* 改为inline，紧跟期刊名称 */
  padding: 5px 10px !important; /* 统一为资源按钮尺寸 */
  border-radius: 6px !important; /* 统一为资源按钮圆角 */
  font-size: 12px !important; /* 统一为资源按钮字号 */
  font-weight: 700 !important; /* 加粗以区分资源按钮 */
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  white-space: nowrap !important;
  margin-left: 6px !important; /* 与期刊名称保持小间距 */
  margin-right: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  border: 1px solid transparent !important;
  line-height: 1.2 !important; /* 统一行高 */
  box-shadow: 0 1px 4px rgba(0,0,0,0.08) !important; /* 统一阴影 */
  transition: all 0.18s ease !important; /* 统一过渡效果 */
  vertical-align: baseline !important; /* 与文字基线对齐 */
}

/* Tier Button Colors */
.pub-tier-btn.ccf-a {
  background: #dc2626;
  color: white;
  border-color: #b91c1c;
}

.pub-tier-btn.ccf-b {
  background: #ea580c;
  color: white;
  border-color: #c2410c;
}

.pub-tier-btn.sci-1 {
  background: #7c3aed;
  color: white;
  border-color: #6d28d9;
}

.pub-tier-btn.sci-2 {
  background: #2563eb;
  color: white;
  border-color: #1d4ed8;
}

.pub-tier-btn.others {
  background: #64748b;
  color: white;
  border-color: #475569;
}

/* Line 4: Resource Buttons */
.publication-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 8px 0 0 0;
  padding-left: 56px; /* Align with title */
}

.publication-buttons .btn {
  margin: 0 !important;
  font-size: 12px !important; /* 统一到主页标准：12px */
  padding: 5px 10px !important; /* 统一到主页标准：5px 10px */
  line-height: 1.2 !important;
  border-radius: 6px !important;
  font-weight: 500 !important;
  text-transform: none !important;
  letter-spacing: 0.2px !important;
  transition: all 0.2s ease !important;
  border: 1px solid transparent !important;
}

/* Resource Button Colors - Distinguished from Tier Buttons */
.btn-res-pdf {
  background: #ef4444;
  color: white;
  border-color: #dc2626;
}

.btn-res-pdf:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.btn-res-code {
  background: #10b981;
  color: white;
  border-color: #059669;
}

.btn-res-code:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-res-poster, .btn-res-slides {
  background: #3b82f6;
  color: white;
  border-color: #2563eb;
}

.btn-res-poster:hover, .btn-res-slides:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.btn-res-blog {
  background: #8b5cf6;
  color: white;
  border-color: #7c3aed;
}

.btn-res-blog:hover {
  background: #7c3aed;
  transform: translateY(-1px);
}

.btn-res-news {
  background: #f59e0b;
  color: white;
  border-color: #d97706;
}

.btn-res-news:hover {
  background: #d97706;
  transform: translateY(-1px);
}

.btn-res-bibtex {
  background: #6b7280;
  color: white;
  border-color: #4b5563;
}

.btn-res-bibtex:hover {
  background: #4b5563;
  transform: translateY(-1px);
}

.btn-res-video, .btn-res-audio {
  background: #ec4899;
  color: white;
  border-color: #db2777;
}

.btn-res-video:hover, .btn-res-audio:hover {
  background: #db2777;
  transform: translateY(-1px);
}

.btn-res-external {
  background: #06b6d4;
  color: white;
  border-color: #0891b2;
}

.btn-res-external:hover {
  background: #0891b2;
  transform: translateY(-1px);
}

.btn-res-internal {
  background: #84cc16;
  color: white;
  border-color: #65a30d;
}

.btn-res-internal:hover {
  background: #65a30d;
  transform: translateY(-1px);
}

.btn-res-supp {
  background: #f97316;
  color: white;
  border-color: #ea580c;
}

.btn-res-supp:hover {
  background: #ea580c;
  transform: translateY(-1px);
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
  /* Year Headers */
  .pub-year {
    font-size: 20px;
    margin: 20px 0 15px 0;
  }
  
  /* Content Cards */
  .content-card {
    padding: 18px;
    margin-bottom: 14px;
    border-radius: 10px;
  }
  
  /* Title Container */
  .pub-title-container {
    gap: 10px;
  }
  
  .pub-number-circle {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  
  .pub-title {
    font-size: 16px;
    line-height: 1.3;
  }
  
  /* Authors */
  .pub-authors {
    font-size: 14px;
    padding-left: 46px; /* Adjust for smaller circle */
  }
  
  /* Venue Container - 平板端 */
  .pub-venue-container {
    padding-left: 46px;
    line-height: 1.5; /* 调整行高适应平板 */
  }
  
  .pub-venue {
    font-size: 14px;
  }
  
  .pub-tier-btn {
    padding: 4px 8px !important; /* 统一为平板端资源按钮尺寸 */
    font-size: 10px !important; /* 统一为平板端资源按钮字号 */
    border-radius: 5px !important; /* 统一为平板端资源按钮圆角 */
    font-weight: 700 !important; /* 加粗以区分 */
    margin-left: 5px !important; /* 平板端减小间距 */
    line-height: 1.2 !important; /* 统一行高 */
    box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important; /* 统一阴影 */
  }

  /* Publication Buttons */
  .publication-buttons {
    padding-left: 46px;
    gap: 6px;
  }

  .publication-buttons .btn {
    font-size: 10px !important; /* 资源按钮：10px (与主页一致) */
    padding: 4px 8px !important; /* 资源按钮：4px 8px (与主页一致) */
  }
}

@media (max-width: 480px) {
  /* Year Headers */
  .pub-year {
    font-size: 18px;
    margin: 15px 0 12px 0;
  }
  
  /* Content Cards */
  .content-card {
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 8px;
  }
  
  /* Publication Content Layout */
  .publication-content {
    gap: 10px;
  }
  
  /* Title Container */
  .pub-title-container {
    gap: 8px;
    flex-direction: row;
    align-items: flex-start;
  }
  
  .pub-number-circle {
    width: 32px;
    height: 32px;
    font-size: 14px;
    margin-top: 0;
  }
  
  .pub-title {
    font-size: 15px;
    line-height: 1.3;
    padding-top: 0;
  }
  
  /* Authors */
  .pub-authors {
    font-size: 13px;
    padding-left: 40px; /* Adjust for smaller circle */
    line-height: 1.4;
  }
  
  /* Venue Container - 手机端 */
  .pub-venue-container {
    padding-left: 40px;
    line-height: 1.4; /* 手机端适合的行高 */
  }
  
  .pub-venue {
    font-size: 13px;
    display: inline; /* 确保期刊名称为inline */
  }
  
  .pub-tier-btn {
    padding: 3px 7px !important; /* 统一为手机端资源按钮尺寸 */
    font-size: 8px !important; /* 统一为手机端资源按钮字号 */
    border-radius: 4px !important; /* 统一为手机端资源按钮圆角 */
    font-weight: 700 !important; /* 加粗以区分 */
    margin-left: 4px !important; /* 手机端更小间距 */
    margin-top: 0 !important; /* 确保不会上下偏移 */
    line-height: 1.2 !important; /* 统一行高 */
    box-shadow: 0 1px 2px rgba(0,0,0,0.06) !important; /* 统一阴影 */
  }

  /* Publication Buttons */
  .publication-buttons {
    padding-left: 40px;
    gap: 5px;
    margin-top: 6px;
  }

  .publication-buttons .btn {
    font-size: 8px !important; /* 资源按钮：8px (与主页一致) */
    padding: 3px 7px !important; /* 资源按钮：3px 7px (与主页一致) */
    border-radius: 4px !important;
  }
}

/* Extra Small Devices */
@media (max-width: 320px) {
  .content-card {
    padding: 12px;
  }
  
  .pub-number-circle {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  
  .pub-title {
    font-size: 14px;
  }
  
  .pub-authors, .pub-venue {
    font-size: 12px;
  }
  
  .pub-authors, .pub-venue-container, .publication-buttons {
    padding-left: 36px;
  }
  
  .publication-buttons .btn {
    font-size: 8px !important; /* 资源按钮：8px (与主页手机端一致) */
    padding: 3px 6px !important; /* 资源按钮：3px 6px */
  }
  
  .pub-tier-btn {
    font-size: 7px !important; /* 等级按钮：7px (比资源按钮小1px) */
    padding: 2px 4px !important; /* 等级按钮：2px 4px (比资源按钮小) */
  }
}

.pub-tier-btn.ccf-a {
  background: #dc2626;
  color: white;
}

.pub-tier-btn.ccf-b {
  background: #ea580c;
  color: white;
}

.pub-tier-btn.sci-1 {
  background: #7c3aed;
  color: white;
}

.pub-tier-btn.sci-2 {
  background: #2563eb;
  color: white;
}

.pub-tier-btn.others {
  background: #64748b;
  color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
  .content-card {
    padding: 15px 18px;
    margin-bottom: 15px;
  }
  
  .pub-number-circle {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  
  .pub-title {
    font-size: 15px;
  }
  
  .pub-authors {
    font-size: 13px;
  }
  
  .pub-venue {
    font-size: 13px;
  }
  
  .pub-venue-container {
    line-height: 1.5; /* 确保合适的行高 */
  }
  
  .pub-venue {
    display: inline; /* 确保期刊名称为inline */
  }
  
  .pub-tier-btn {
    margin-left: 5px !important; /* 平板端间距 */
    font-size: 10px !important; /* 统一为平板端资源按钮字号 */
    padding: 4px 8px !important; /* 统一为平板端资源按钮尺寸 */
    border-radius: 5px !important; /* 统一为平板端资源按钮圆角 */
    font-weight: 700 !important; /* 加粗以区分 */
    line-height: 1.2 !important; /* 统一行高 */
    box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important; /* 统一阴影 */
  }
  
  .publication-buttons {
    gap: 6px;
  }
  
  .publication-buttons .btn {
    font-size: 10px !important; /* 资源按钮：10px (与主页平板端一致) */
    padding: 4px 8px !important; /* 资源按钮：4px 8px (与主页平板端一致) */
  }
  
  .pub-year {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .content-card {
    padding: 12px 15px;
    margin-bottom: 12px;
  }
  
  .pub-title-container {
    gap: 6px;
  }
  
  .pub-title {
    font-size: 14px;
  }
  
  .pub-venue-container {
    line-height: 1.4; /* 手机端行高 */
  }
  
  .pub-venue {
    font-size: 12px;
    display: inline; /* 确保期刊名称为inline */
  }
  
  .pub-tier-btn {
    margin-left: 4px !important; /* 手机端小间距 */
    font-size: 8px !important; /* 统一为手机端资源按钮字号 */
    padding: 3px 7px !important; /* 统一为手机端资源按钮尺寸 */
    border-radius: 4px !important; /* 统一为手机端资源按钮圆角 */
    font-weight: 700 !important; /* 加粗以区分 */
    line-height: 1.2 !important; /* 统一行高 */
    box-shadow: 0 1px 2px rgba(0,0,0,0.06) !important; /* 统一阴影 */
  }
  
  .publication-buttons .btn {
    font-size: 8px !important; /* 资源按钮：8px (与主页手机端一致) */
    padding: 3px 7px !important; /* 资源按钮：3px 7px (与主页手机端一致) */
    border-radius: 4px !important;
  }
}
