@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 0.3; }
  100% { opacity: 0.6; }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
  font-family: 'Inter', system-ui, -apple-system, sans-serif; 
  background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%); 
  min-height: 100vh; 
  color: #2d3748; 
}

/* Header & Filter Bar */
header { 
  background: rgba(255, 255, 255, 0.7); 
  backdrop-filter: blur(12px); 
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4); 
  padding: 16px 24px;
  display: flex; align-items: center; gap: 12px; 
  position: sticky; top: 0; z-index: 20; 
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  flex-wrap: wrap;
}
header h1 { font-size: 1.1rem; font-weight: 700; flex: 1; color: #1a202c; letter-spacing: -0.02em; min-width: 100px;}
.date-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;}
.date-picker { font-family: inherit; font-size: 1rem; font-weight: 600; color: #4a5568; border: 1px solid #e2e8f0; border-radius: 8px; padding: 6px 12px; background: #fff; cursor: pointer; outline: none; transition: border-color 0.2s;}
.date-picker:focus { border-color: #3182ce; }
.search-input { padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 0.9rem; outline: none; min-width: 200px; transition: border-color 0.2s;}
.search-input:focus { border-color: #3182ce; }

button { 
  cursor: pointer; padding: 8px 16px; border: 1px solid #e2e8f0; color: #2d3748;
  border-radius: 8px; background: #fff; font-size: 0.9rem; font-weight: 500;
  transition: all 0.2s ease; box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
button:hover:not(:disabled) { background: #f7fafc; transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.filter-bar { 
  background: rgba(255, 255, 255, 0.6); 
  backdrop-filter: blur(8px);
  padding: 10px 24px; border-bottom: 1px solid rgba(0,0,0,0.05); 
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; 
  position: sticky; top: 68px; z-index: 10;
}
.filter-bar span { font-size: 0.9rem; font-weight: 600; color: #718096; }
.f-btn { padding: 6px 14px; border-radius: 20px; font-size: 0.85rem; border: 1px solid transparent; background: #edf2f7; color: #4a5568; }
.f-btn:hover { background: #e2e8f0; }
.f-btn.active { background: #3182ce; color: #fff; box-shadow: 0 4px 12px rgba(49, 130, 206, 0.3); }

/* Main Layout */
main { max-width: 1500px; margin: 30px auto; padding: 0 24px; padding-bottom: 60px; }
.grid-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: 24px; margin-bottom: 30px; }
.section-title { font-size: 0.85rem; font-weight: 700; color: #a0aec0; text-transform: uppercase;
  letter-spacing: 0.08em; margin: 30px 0 12px; display: flex; align-items: center; }
.section-title::after { content: ''; flex: 1; height: 1px; background: #e2e8f0; margin-left: 12px; }

/* Cards */
.card { 
  background: rgba(255, 255, 255, 0.85); border: 1px solid rgba(255,255,255,1); 
  border-radius: 16px; padding: 20px 24px; 
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeUp 0.4s ease forwards;
}
.card:hover { 
  transform: translateY(-4px); 
  box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -5px rgba(0, 0, 0, 0.04); 
}
.card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; line-height: 1.4; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-title a { color: #2b6cb0; text-decoration: none; transition: color 0.2s; flex: 1; }
.card-title a:hover { color: #1a365d; text-decoration: underline; }
.card-title-zh { color: #2d3748; font-size: 1rem; font-weight: 600; margin-bottom: 8px; line-height: 1.5; }
.card-meta { font-size: 0.8rem; font-weight: 500; color: #718096; margin-bottom: 12px; display: inline-block; padding: 4px 10px; background: #edf2f7; border-radius: 12px; }

.pdf-link { font-size: 0.75rem; font-weight: 700; color: #fff !important; background: #4f46e5; padding: 4px 10px; border-radius: 20px; text-decoration: none !important; white-space: nowrap; box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3); transition: all 0.2s; }
.pdf-link:hover { background: #4338ca; transform: scale(1.05); }

/* Typography */
.abstract { font-size: 0.9rem; color: #4a5568; line-height: 1.7; margin-top: 12px; }
.abstract strong { color: #2d3748; font-weight: 600; }
.arxiv-details { margin-top: 12px; border-top: 1px solid #edf2f7; padding-top: 8px; }
.arxiv-details summary { font-size: 0.85rem; color: #718096; cursor: pointer; font-weight: 600; transition: color 0.2s; user-select: none; display: inline-block;}
.arxiv-details summary:hover { color: #2b6cb0; }
.arxiv-details p { font-size: 0.85rem; color: #4a5568; line-height: 1.7; margin-top: 8px; padding: 12px; background: #f7fafc; border-radius: 8px; white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;}

/* Badges */
.labels { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; border-top: 1px dashed #e2e8f0; padding-top: 16px; }
.lbl { padding: 6px 14px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; border: 1px solid transparent; background: #edf2f7; color: #718096; cursor: pointer; transition: all 0.2s ease; box-shadow: none; }
.lbl:hover { background: #e2e8f0; color: #4a5568; }
.lbl.active-相关 { background: #d1fae5; color: #065f46; box-shadow: 0 0 0 1px #a7f3d0 inset; }
.lbl.active-感兴趣 { background: #dbeafe; color: #1e40af; box-shadow: 0 0 0 1px #bfdbfe inset; }
.lbl.active-组会报告 { background: #fef3c7; color: #92400e; box-shadow: 0 0 0 1px #fde68a inset; }
.lbl.active-不相关 { background: #fee2e2; color: #b91c1c; box-shadow: 0 0 0 1px #fecaca inset; }

/* Loaders & Pagination */
#empty, .load-more-ctn { text-align: center; color: #a0aec0; padding: 40px 0; font-size: 1.1rem; font-weight: 500; }
.spinner { display: inline-block; width: 20px; height: 20px; border: 3px solid rgba(203,213,225,0.3); border-radius: 50%; border-top-color: #3182ce; animation: spin 1s ease-in-out infinite; vertical-align: middle; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton-card { background: rgba(255, 255, 255, 0.5); border: 1px solid rgba(255,255,255,0.5); border-radius: 16px; padding: 20px 24px; min-height: 200px; }
.sk-title { height: 24px; background: #e2e8f0; border-radius: 4px; width: 80%; margin-bottom: 12px; animation: pulse 1.5s infinite ease-in-out; }
.sk-line { height: 16px; background: #edf2f7; border-radius: 4px; width: 100%; margin-bottom: 8px; animation: pulse 1.5s infinite ease-in-out; }
.sk-line.short { width: 60%; }

/* Modal Calendar */
.modal {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.4); z-index: 100; backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.modal-content {
  background: #fff; width: 95%; max-width: 1200px; height: 90%; border-radius: 16px;
  display: flex; flex-direction: column; box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  overflow: hidden; animation: fadeUp 0.3s ease;
}
.modal-header {
  padding: 20px; border-bottom: 1px solid #e2e8f0; display: flex; justify-content: space-between; align-items: center;
}
.modal-header h2 { display: flex; align-items: center; gap: 15px; color: #2d3748; }
.cal-nav { background: #edf2f7; border: none; border-radius: 8px; font-weight: bold; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.cal-nav:hover { background: #e2e8f0; }
.close-btn { font-size: 1.5rem; background: none; border: none; cursor: pointer; color: #a0aec0; box-shadow: none; padding: 0;}
.close-btn:hover { color: #2d3748; background: none; box-shadow: none; transform: scale(1.1); }
.modal-body {
  flex: 1; overflow-y: auto; padding: 20px; 
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px;
}
/* Calendar month styling */
.month-card { border: 1px solid #e2e8f0; border-radius: 12px; padding: 15px; }
.month-title { font-weight: 700; text-align: center; margin-bottom: 10px; color: #4a5568; }
.days-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.day-head { text-align: center; font-size: 0.75rem; font-weight: 600; color: #a0aec0; padding-bottom: 4px; }
.day-cell { 
   aspect-ratio: 1; display: flex; align-items: center; justify-content: center; 
   font-size: 0.85rem; border-radius: 6px; cursor: default; color: #cbd5e0;
}
.day-cell.active {
   background: #ebf8ff; color: #3182ce; font-weight: 700; cursor: pointer; border: 1px solid #bee3f8; transition: all 0.2s;
}
.day-cell.active:hover { background: #3182ce; color: #fff; transform: scale(1.1); }
.day-cell.empty { background: transparent; }

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  body { background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%); color: #e2e8f0; }
  header { background: rgba(26, 32, 44, 0.8); border-bottom-color: rgba(255,255,255,0.1); }
  header h1 { color: #f7fafc; }
  .filter-bar { background: rgba(26, 32, 44, 0.8); border-bottom-color: rgba(255,255,255,0.05); }
  .filter-bar span { color: #a0aec0; }
  .card { background: rgba(45, 55, 72, 0.85); border-color: rgba(255,255,255,0.05); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.3); }
  .card-title a { color: #63b3ed; }
  .card-title a:hover { color: #90cdf4; }
  .card-title-zh { color: #e2e8f0; }
  .card-meta, .f-btn, .lbl { background: #4a5568; color: #e2e8f0; }
  .abstract { color: #cbd5e0; }
  .abstract strong { color: #f7fafc; }
  .arxiv-details { border-top-color: #4a5568; }
  .arxiv-details summary { color: #a0aec0;}
  .arxiv-details p { background: #1a202c; color: #a0aec0; }
  .labels { border-top-color: #4a5568; }
  
  .f-btn:hover, .lbl:hover { background: #2d3748; }
  .f-btn.active { background: #3182ce; color: #fff; }
  .lbl.active-相关 { background: #065f46; color: #d1fae5; box-shadow: 0 0 0 1px #047857 inset; }
  .lbl.active-感兴趣 { background: #1e40af; color: #dbeafe; box-shadow: 0 0 0 1px #1d4ed8 inset; }
  .lbl.active-组会报告 { background: #92400e; color: #fef3c7; box-shadow: 0 0 0 1px #b45309 inset; }
  .lbl.active-不相关 { background: #991b1b; color: #fee2e2; box-shadow: 0 0 0 1px #b91c1c inset; }

  .date-picker, .search-input, button { background: #2d3748; border-color: #4a5568; color: #e2e8f0; }
  button:hover:not(:disabled) { background: #4a5568; }
  .section-title::after { background: #4a5568; }
  
  .skeleton-card { background: rgba(45, 55, 72, 0.5); border-color: rgba(255,255,255,0.05); }
  .sk-title { background: #4a5568; }
  .sk-line { background: #2d3748; }

  /* Calendar Modal Dark */
  .modal-content { background: #1a202c; border: 1px solid rgba(255,255,255,0.1); }
  .modal-header { border-bottom-color: rgba(255,255,255,0.1); }
  .modal-header h2 { color: #e2e8f0; }
  .cal-nav { background: #4a5568; color: #fff; }
  .cal-nav:hover { background: #2d3748; }
  .month-card { border-color: rgba(255,255,255,0.1); }
  .month-title { color: #e2e8f0; }
  .day-cell { color: #4a5568; }
  .day-cell.active { background: rgba(49, 130, 206, 0.2); color: #63b3ed; border-color: rgba(49, 130, 206, 0.4); }
  .day-cell.active:hover { background: #3182ce; color: #fff; }
}

@media (max-width: 600px) {
  header { flex-direction: column; align-items: stretch; gap: 10px; }
  .date-controls { justify-content: space-between; }
  .search-box { width: 100%; display: flex; gap: 8px;}
  .search-input { width: 100%; flex: 1; min-width: unset; }
  .filter-bar { top: 120px; }
}
