/* 时光的三种看法：时间线 / 系列 / 学期；以及总览里的学习入口 */

/* 视图切换 */
.view-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 99px;
  background: var(--glass-card);
  border: 1px solid var(--line);
  flex: none;
}

.view-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  padding: 6px 14px;
  border-radius: 99px;
  cursor: pointer;
  transition: color .2s ease, background .25s ease, box-shadow .25s ease;
}

.view-tab:hover { color: var(--text); }
.view-tab.active {
  color: var(--text);
  background: var(--accent-soft);
  box-shadow: 0 6px 18px -10px rgba(210, 226, 255, .9);
  font-weight: 600;
}

/* 生效中的筛选 */
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }

.active-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--violet);
  padding: 6px 8px 6px 12px;
  border-radius: 99px;
  background: var(--glass-card);
  border: 1px solid var(--line);
  animation: fade-in .35s ease both;
}

.active-filter button {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 0;
  background: var(--input-surface);
  color: var(--muted);
  cursor: pointer;
  transition: color .2s ease, background .2s ease;
}
.active-filter button:hover { color: var(--text); background: var(--input-surface); }
.active-filter svg { width: 10px; height: 10px; }

/* 视图标题 */
.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 6px 2px 14px;
}
.view-head h2 { margin: 0 0 3px; font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.view-head p { margin: 0; font-size: 12.5px; }
.view-count { font-size: 11.5px; color: var(--muted); letter-spacing: .03em; flex: none; }

/* 系列卡 */
.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.series-card {
  appearance: none;
  font: inherit;
  text-align: left;
  color: var(--text);
  padding: 16px 18px 14px;
  display: grid;
  gap: 8px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .28s cubic-bezier(.22, .68, 0, 1), border-color .28s ease, box-shadow .28s ease;
  animation: rise .5s cubic-bezier(.22, .68, 0, 1) both;
}
.series-card:nth-child(2) { animation-delay: .05s; }
.series-card:nth-child(3) { animation-delay: .1s; }
.series-card:nth-child(4) { animation-delay: .15s; }
.series-card:nth-child(n+5) { animation-delay: .2s; }
.series-card::after {
  content: "";
  position: absolute;
  inset: auto -30% -60% auto;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(180, 215, 255, .12), transparent 68%);
  pointer-events: none;
  transition: opacity .3s ease;
  opacity: .7;
}
.series-card:hover { transform: translateY(-3px); border-color: var(--line); box-shadow: 0 26px 46px -32px rgba(0, 0, 0, .95); }
.series-card:hover::after { opacity: 1; }

.series-top { display: flex; align-items: center; justify-content: space-between; }
.series-count { font-size: 22px; font-weight: 650; letter-spacing: -.02em; color: var(--blue); }
.series-count small { font-size: 10.5px; color: var(--muted); margin-left: 3px; letter-spacing: .04em; }
.series-card h3 { margin: 0; font-size: 15.5px; font-weight: 600; line-height: 1.35; }
.series-span { margin: 0; font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }

.series-dots { display: flex; align-items: center; gap: 5px; min-height: 12px; flex-wrap: wrap; margin: 2px 0; }
.series-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--glass-card-bright);
  transition: transform .2s ease;
}
.series-dots i.dot-important { width: 9px; height: 9px; background: rgba(216, 201, 163, .85); }
.series-dots i.dot-milestone { width: 11px; height: 11px; background: var(--alert); box-shadow: 0 0 10px rgba(212, 224, 255, .55); }
.series-card:hover .series-dots i { transform: scale(1.12); }

.series-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
  font-size: 11px;
  color: var(--muted);
}

/* 学期总览 */
.semester-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}

.semester-card {
  appearance: none;
  font: inherit;
  text-align: left;
  color: var(--text);
  padding: 18px;
  display: grid;
  gap: 12px;
  cursor: pointer;
  transition: transform .28s cubic-bezier(.22, .68, 0, 1), border-color .28s ease, box-shadow .28s ease;
  animation: rise .5s cubic-bezier(.22, .68, 0, 1) both;
}
.semester-card:nth-child(2) { animation-delay: .06s; }
.semester-card:nth-child(3) { animation-delay: .12s; }
.semester-card:nth-child(n+4) { animation-delay: .18s; }
.semester-card:hover { transform: translateY(-3px); border-color: var(--line); box-shadow: 0 26px 46px -32px rgba(0, 0, 0, .95); }

.semester-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.semester-head .eyebrow { font-size: 10.5px; letter-spacing: .16em; }
.semester-head h3 { margin: 2px 0 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.semester-count { font-size: 24px; font-weight: 650; letter-spacing: -.02em; color: var(--blue); }
.semester-count small { font-size: 10.5px; color: var(--muted); margin-left: 3px; }

.semester-bar {
  display: flex;
  gap: 2px;
  height: 5px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--glass-card);
}
.semester-bar span { display: block; height: 100%; border-radius: 2px; }
.semester-bar .seg-milestone { background: var(--alert); }
.semester-bar .seg-important { background: rgba(216, 201, 163, .85); }
.semester-bar .seg-daily { background: rgba(180, 215, 255, .42); }

.semester-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.semester-list li { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--violet); }
.semester-list li span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.semester-list li small { color: var(--muted); font-size: 10.5px; flex: none; }
.semester-list li.muted { font-size: 11.5px; color: var(--muted); display: block; }
.semester-list i { width: 6px; height: 6px; border-radius: 50%; flex: none; }

.semester-foot {
  display: flex;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 10.5px;
  color: var(--muted);
  flex-wrap: wrap;
}
.semester-foot span { display: inline-flex; align-items: center; gap: 5px; }
.semester-foot i { width: 5px; height: 5px; border-radius: 50%; }

.dot-daily { background: rgba(180, 215, 255, .55); }
.dot-important { background: rgba(216, 201, 163, .9); }
.dot-milestone { background: var(--alert); box-shadow: 0 0 8px rgba(212, 224, 255, .5); }

.importance-label.importance-daily { color: var(--muted); }
.importance-label.importance-important { color: var(--muted); }
.importance-label.importance-milestone { color: var(--alert); }

/* 总览里的学习入口 */
.study-ribbon {
  width: 100%;
  appearance: none;
  font: inherit;
  color: var(--text);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin-top: 14px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .26s cubic-bezier(.22, .68, 0, 1), border-color .26s ease, box-shadow .26s ease;
  animation: rise .55s cubic-bezier(.22, .68, 0, 1) both;
}
.study-ribbon::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(180, 215, 255, .8), transparent);
  opacity: 0;
  transition: opacity .3s ease;
}
.study-ribbon:hover { transform: translateY(-2px); border-color: var(--line); box-shadow: 0 22px 42px -30px rgba(0, 0, 0, .95); }
.study-ribbon:hover::after { opacity: 1; }

.ribbon-icon {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--blue);
  background: var(--glass-card);
  border: 1px solid var(--line);
}
.ribbon-copy { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ribbon-copy b { font-size: 13.5px; font-weight: 600; letter-spacing: .01em; }
.ribbon-copy small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ribbon-progress { display: grid; gap: 5px; flex: none; width: 108px; justify-items: end; }
.ribbon-pct { font-size: 13px; font-weight: 600; color: var(--blue); letter-spacing: -.01em; }
.ribbon-bar { width: 100%; height: 4px; border-radius: 99px; background: var(--glass-card); overflow: hidden; }
.ribbon-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8fc0f5, #e8b6d2); }

@keyframes fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

@media (max-width: 720px) {
  .view-tabs { width: 100%; justify-content: space-between; }
  .view-tab { flex: 1; text-align: center; }
  .series-grid, .semester-grid { grid-template-columns: 1fr; }
  .view-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .ribbon-progress { width: 78px; }
  .ribbon-copy small { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .series-card, .semester-card, .study-ribbon, .active-filter { animation: none !important; }
  .series-card, .semester-card, .study-ribbon, .series-dots i { transition: none; }
}

/* toolbar: search + view tabs on row 1, filters right-aligned on row 2 */
.timeline-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
}
.timeline-toolbar .timeline-search { flex: 1 1 300px; min-width: 0; }
.timeline-toolbar .view-tabs { flex: none; margin-left: auto; }
.timeline-toolbar .filter-controls {
  flex: 1 1 100%;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}
.viewer-control { white-space: nowrap; flex: none; }
.timeline-toolbar select { width: auto; flex: 0 0 auto; }

@media (max-width: 1100px) {
  .timeline-toolbar .filter-controls { justify-content: flex-start; }
}

@media (max-width: 700px) {
  .timeline-toolbar { gap: 10px; }
  .timeline-toolbar .view-tabs { margin-left: 0; width: 100%; justify-content: space-between; }
  .timeline-toolbar .filter-controls { gap: 7px; }
}
