.qrecent-widget{
  padding: 2.5rem 0;
}

.qrecent-card{
  position: relative;
  background: var(--bs-surface);
  border: 1px solid var(--bs-border-color);
  border-radius: 1.1rem;
  padding: 1.35rem 1.6rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.qrecent-card::before{
  content: "";
  position: absolute;
  inset: -30% auto auto -10%;
  width: 320px;
  height: 220px;
  background: radial-gradient(closest-side, rgba(24,86,201,.18), transparent 70%);
  pointer-events: none;
}

.qrecent-card::after{
  content: "";
  position: absolute;
  inset: auto -30% -40% auto;
  width: 360px;
  height: 240px;
  background: radial-gradient(closest-side, rgba(14,165,233,.14), transparent 70%);
  pointer-events: none;
}

.qrecent-head{
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.qrecent-title h2{
  margin: 0;
  font-size: 1.35rem;
  color: var(--bs-heading);
}

.qrecent-kicker{
  margin: 0 0 .3rem;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--bs-muted);
}

.qrecent-sub{
  margin: .4rem 0 0;
  color: var(--bs-muted);
  font-size: .9rem;
}

.qrecent-actions{
  display: grid;
  gap: .65rem;
  justify-items: end;
}

.qrecent-meta-row{
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
}

.qrecent-search{
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: .5rem;
  padding: .35rem .5rem;
  border-radius: 999px;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-surface-2);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.4);
}

.qrecent-search-icon{
  width: 1rem;
  height: 1rem;
  color: var(--bs-muted);
}

.qrecent-search input{
  border: none;
  background: transparent;
  outline: none;
  min-width: 12rem;
  font-size: .9rem;
  color: var(--bs-heading);
}

.qrecent-clear{
  border: none;
  background: transparent;
  color: var(--bs-muted);
  font-size: .8rem;
  cursor: pointer;
}

.qrecent-submit{
  border: none;
  background: var(--bs-primary);
  color: #ffffff;
  padding: .35rem .75rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease;
}

.qrecent-submit:hover{
  box-shadow: 0 6px 14px rgba(14,165,233,.2);
  transform: translateY(-1px);
}

.qrecent-limit{
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  color: var(--bs-muted);
  flex: 0 0 auto;
  white-space: nowrap;
}

.qrecent-limit select{
  border-radius: .6rem;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-surface);
  padding: .25rem .45rem;
  font-size: .82rem;
  color: var(--bs-heading);
}

.qrecent-status{
  margin: 0;
  font-size: .85rem;
  color: var(--bs-muted);
  flex: 1 1 auto;
  min-width: 0;
}

.qrecent-list{
  list-style: none;
  margin: .8rem 0 0;
  padding: 0;
  display: grid;
  gap: .7rem;
}

.qrecent-item{
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .9rem;
  align-items: center;
  padding: .75rem .85rem;
  border-radius: .9rem;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-surface-2);
  transition: box-shadow .2s ease, transform .18s ease, border-color .2s ease;
}

.qrecent-item:hover{
  border-color: rgba(24,86,201,.35);
  box-shadow: 0 8px 18px rgba(15,23,42,.12);
  transform: translateY(-1px);
}

.qrecent-date{
  padding: .4rem .65rem;
  border-radius: .75rem;
  background: linear-gradient(135deg, rgba(24,86,201,.12), rgba(14,165,233,.12));
  color: #0b1220;
  text-align: center;
  min-width: 7.5rem;
}

.qrecent-date-label{
  display: block;
  font-weight: 700;
  font-size: .85rem;
}

.qrecent-date-caption{
  display: block;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: rgba(15,23,42,.6);
}

.qrecent-main{
  min-width: 0;
}

.qrecent-title-link{
  display: inline-block;
  font-weight: 600;
  color: var(--bs-heading);
  text-decoration: none;
}

.qrecent-title-link:hover{
  color: var(--bs-primary-600);
  text-decoration: underline;
}

.qrecent-meta{
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .35rem;
  font-size: .8rem;
}

.qrecent-chip{
  padding: .12rem .55rem;
  border-radius: 999px;
  background: rgba(24,86,201,.12);
  color: #1d4ed8;
  font-weight: 500;
}

.qrecent-action{
  display: flex;
  justify-content: flex-end;
}

.qrecent-open{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .35rem .75rem;
  border-radius: .6rem;
  border: 1px solid var(--bs-border-color);
  background: #ffffff;
  color: var(--bs-heading);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  gap: .35rem;
  transition: box-shadow .15s ease, transform .12s ease, border-color .15s ease;
}

.qrecent-open-icon{
  width: 1rem;
  height: 1rem;
}

.qrecent-open:hover{
  border-color: rgba(14,165,233,.5);
  box-shadow: 0 4px 12px rgba(15,23,42,.12);
  transform: translateY(-1px);
}

.qrecent-open:active{
  transform: translateY(0);
  box-shadow: none;
}

.qrecent-footer{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.qrecent-pagination{
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.qrecent-page-btn{
  border: 1px solid var(--bs-border-color);
  background: var(--bs-surface);
  color: var(--bs-muted);
  padding: .3rem .6rem;
  border-radius: .6rem;
  font-size: .82rem;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, color .15s ease;
}

.qrecent-page-btn.is-active{
  color: #ffffff;
  background: var(--bs-secondary);
  border-color: var(--bs-secondary);
  box-shadow: 0 0 0 3px rgba(24,86,201,.16);
}

.qrecent-page-btn:disabled{
  opacity: .5;
  cursor: not-allowed;
}

.qrecent-empty{
  margin: .8rem 0 0;
  color: var(--bs-muted);
}

.qrecent-widget.is-loading .qrecent-card{
  opacity: .85;
}

html[data-theme="dark"] .qrecent-date{
  color: #e2e8f0;
}

html[data-theme="dark"] .qrecent-open{
  background: #0f172a;
  color: #e2e8f0;
}

@media (max-width: 1000px){
  .qrecent-actions{
    width: 100%;
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .qrecent-search{
    width: 100%;
  }

  .qrecent-chip--chapter{
    display: none;
  }
}

@media (max-width: 800px){
  .qrecent-chip--topic{
    display: none;
  }

  .qrecent-chip--subject{
    display: none;
  }

  .qrecent-open-label{
    display: none;
  }

  .qrecent-action{
    display: none;
  }

  .qrecent-item{
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: .7rem;
  }

  .qrecent-date{
    flex: 0 0 auto;
    min-width: 6.5rem;
    white-space: nowrap;
  }

  .qrecent-main{
    flex: 1 1 auto;
    min-width: 0;
  }

  .qrecent-action{
    flex: 0 0 auto;
  }
}

@media (max-width: 760px){
  .qrecent-item{
    grid-template-columns: 1fr auto;
    grid-template-areas: "main action" "date action";
  }
  .qrecent-date{
    min-width: 0;
    text-align: left;
  }
  .qrecent-open{
    padding: .35rem;
    width: 2.1rem;
    height: 2.1rem;
    justify-content: center;
  }
  .qrecent-open-label{
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
}

@media (max-width: 600px){
  .qrecent-search{
    grid-template-columns: auto 1fr auto;
  }
  .qrecent-clear{
    display: none;
  }

  .qrecent-chip--subject{
    display: none;
  }

  .qrecent-action{
    display: none;
  }

  .qrecent-title h2{
    font-size: 1.1rem;
  }

  .qrecent-sub{
    font-size: .82rem;
  }

  .qrecent-status{
    font-size: .78rem;
  }

  .qrecent-limit{
    font-size: .78rem;
  }

  .qrecent-title-link{
    font-size: .92rem;
  }

  .qrecent-date-label{
    font-size: .78rem;
  }

  .qrecent-date-caption{
    font-size: .6rem;
  }

  .qrecent-meta{
    font-size: .75rem;
  }
}

@media (max-width: 520px){
  .qrecent-card{
    padding: 1rem;
  }
  .qrecent-title h2{
    font-size: 1.15rem;
  }
  .qrecent-item{
    padding: .6rem .65rem;
  }
  .qrecent-date-caption{
    display: none;
  }
  .qrecent-chip{
    display: none;
  }
}
